fix: subagent spinner 在用户终止任务后仍持续转动#181
Open
Andreaseszhang wants to merge 1 commit intoErlichLiu:mainfrom
Open
fix: subagent spinner 在用户终止任务后仍持续转动#181Andreaseszhang wants to merge 1 commit intoErlichLiu:mainfrom
Andreaseszhang wants to merge 1 commit intoErlichLiu:mainfrom
Conversation
问题:用户终止 agent 任务后,子代理(Agent/Task 工具调用)的 spinner 持续转动。 根因:SDK 进程被 abort 后不再发 tool_result 事件,UI 通过检查 JSONL 中是否存在 tool_result 来决定 spinner 状态——缺失 result 导致 spinner 永不停止。 修复方案: - ContentBlock 新增 isStreaming prop,仅流式中的未完成工具调用才显示 spinner - 持久化消息(已结束的 turn)中缺失 result 的工具调用视为已中断,不显示 spinner - handleStop/STREAM_COMPLETE/complete 事件中兜底标记 toolActivities 为 done Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tool_result事件,UI 通过检查 JSONL 中是否存在tool_result决定 spinner 状态——缺失 result 导致 spinner 永不停止ContentBlock新增isStreamingprop,仅流式中的未完成工具调用才显示 spinner;持久化消息中缺失 result 的工具调用视为已中断,不显示 spinnerChanges
ContentBlock.tsxisStreamingprop,spinner 仅在isStreaming && !isCompleted时显示;displayLabel同理切换完成态短语SDKMessageRenderer.tsxisStreaming从AssistantTurnRenderer传递到ContentBlockagent-atoms.tscomplete事件时兜底标记未完成的toolActivities为 doneAgentView.tsxhandleStop时立即标记toolActivitiesdone +teammatesstoppeduseGlobalAgentListeners.tsSTREAM_COMPLETE时标记toolActivitiesdone +teammatesstoppedTest plan
🤖 Generated with Claude Code